﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ArticleListViewModel>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if (Model.Articles != null && Model.Articles.Count > 0)
     {
         var first = Model.Articles[0]; %> 
<div class="art_top pad">
    <div class="art_top_l">
        <a href="/data/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>">
            <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 300, 225, first.ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
            <img src="<%=imgPath %>" title="<%=first.Title %>" alt="<%=first.Title %>" class="bor_img" width="300" height="225" style="overflow:hidden"/>
        </a>
    </div>
    <div class="art_top_r">
        <div class="art_top_r_txt_hd">
            <h3><a href="/data/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>" class="link_org"><%=Html.Encode(first.Title) %></a></h3>
        </div>
        <div class="art_top_r_txt_ct">
             <%=Html.Encode(first.Summary) %>
             <% Html.RenderPartial("~/Views/Data/Attachs.ascx", first); %> 
        </div>
    </div>
</div>
<div class="clear"></div>
<%if (Model.Articles.Count > 1)
    {%>
    <div class="duan_list">
    <ul>
	    <%for (int i = 1; i < Model.Articles.Count; i++)
       {
           string imgPath1 = (Model.Articles[i].ImagePath != null && Model.Articles[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Articles[i].ID, 132, 96, Model.Articles[i].ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;
           %>
	    <li>
    	    <a href="/data/details/<%=Model.Articles[i].ID %>/<%=Html.ToUrlFriendly(Model.Articles[i].Title)%>">
            <img class="bor_img" src="<%=imgPath1 %>" title="<%=Model.Articles[i].Title %>" alt="<%=Model.Articles[i].Title %>" width="132" height="96" /></a>
            <div><a href="/data/details/<%=Model.Articles[i].ID %>/<%=Html.ToUrlFriendly(Model.Articles[i].Title)%>"><strong><%=Html.Encode(Model.Articles[i].Title)%></strong></a></div>
        </li>
        <%}%>
       
    </ul>
    </div>
    <%}%>
<%} %>
<div class="clear"></div>
